import Vue from 'vue'
import App from './App.vue'
import VueRouter from "vue-router";
import ElementUI from 'element-ui'

import routes from "./routes";
import { registerMicroApps, start } from 'qiankun';

Vue.use(VueRouter)
Vue.use(ElementUI)

registerMicroApps([
  {
    name: 'vue', // app name registered
    entry: '//localhost:8081',
    container: '#container',
    activeRule: '/vueRule',
  },
  {
    name: 'react', // app name registered
    entry: '//localhost:3000',
    container: '#container',
    activeRule: '/reactRule',
  },
]);

start();

/**
 * 注册路由实例
 * 即将开始监听 location 变化，触发路由规则
 */
const router = new VueRouter({
  mode: "history",
  routes,
});

Vue.config.productionTip = false
// 创建 Vue 实例
// 该实例将挂载/渲染在 id 为 app 的节点上
new Vue({
  router,
  render: h => h(App),
}).$mount('#app')

// export default apps